import {RootA} from '../views/routeList/root/RootA';
import {ARoutes} from "./route-children/ARoutes";
import {lazy} from "react";

/**
 * 路由元信息
 * path 匹配地址
 * redirect： true：重定向，false：无redirect
 * from: 从哪里来
 * to：去哪里
 * exact:是否精准匹配
 * meta：路由其余信息
 * children:子路由
 * @type {*[]}
 */
const routes = [
    {
        redirect:true,
        exact: true,
        from:'/',
        to:'/a'
    },
    {
      redirect:false,
      path: '/a',
      component: RootA,
      children: ARoutes
    },
    {
        redirect:false,
        path:'/b',
        component:lazy(()=>import(/*webpackChunkName:RootA*/"../views/routeList/root/RootB")),
    },
    {
        redirect:false,
        path:'/c',
        component:lazy(()=>import(/*webpackChunkName:RootC*/'../views/routeList/root/RootC')),
    },
    {
        redirect:true,
        path:'/',
    }
]

export default routes;